package bb.lanxing.device.sgdevcie.setting.fragment

import androidx.lifecycle.ViewModelProvider
import bb.lanxing.R
import bb.lanxing.databinding.FragmentSgDeviceSettingAboutBinding
import bb.lanxing.device.sgdevcie.viewmodel.XossDeviceSGSettingEntryViewModel
import bb.lanxing.device.sgdevcie.viewmodel.DeviceViewModel
import bb.lanxing.mvvm.base.BaseDBFragment

/* compiled from: SGSettingAboutFragment.kt */
class SGSettingAboutFragment :
    BaseDBFragment<FragmentSgDeviceSettingAboutBinding?>(R.layout.fragment_sg_device_setting_about) {
    private val entryViewModel: XossDeviceSGSettingEntryViewModel by lazy {
        ViewModelProvider(this)[XossDeviceSGSettingEntryViewModel::class.java]
    }
    private val viewModel: DeviceViewModel by lazy {
        ViewModelProvider(this)[DeviceViewModel::class.java]
    }

    init {
        val sGSettingAboutFragment = this
    }

    override fun initView(t: FragmentSgDeviceSettingAboutBinding?) {
        if (entryViewModel.address != null
            && entryViewModel.deviceType != null
            && entryViewModel.deviceName != null) {
            val viewModel: DeviceViewModel = viewModel
            val address: String = entryViewModel.address
            val deviceName: String = entryViewModel.deviceName
            val deviceType: Int = entryViewModel.deviceType
            viewModel.init(address, deviceName, deviceType)
        }
        //TODO:hu
//        binding.setName(entryViewModel.getDeviceName())
//        binding.setAdvTime(System.currentTimeMillis() / 1000)
//        binding.setFirVersion(viewModel.firmwareVersion)
//        binding.setModel(viewModel.deviceModel)
    }
}
